package com.perkinelmer.housecall.client.model;

import java.util.Date;

import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
import com.perkinelmer.housecall.client.util.Identifier;

public abstract class Observation {

	private static final DateTimeFormat dateFormat = DateTimeFormat.getFormat(PredefinedFormat.DATE_SHORT);
	private static final DateTimeFormat timeFormat = DateTimeFormat.getFormat(PredefinedFormat.TIME_SHORT);

	private final Date observationTime;
	
	protected Observation() {
		this.observationTime = new Date();
	}
	
	public abstract ObservationId getId();
	
	public final String getDateString() {
		return dateFormat.format(observationTime);
	}
	
	public final String getTimeString() {
		return timeFormat.format(observationTime);
	}
	
	public final String getDescription() {
		return "";
	}
	
	public static class ObservationId extends Identifier {

		public static ObservationId make(String name) {
			return new ObservationId(name);
		}
		
		private ObservationId(String name) {
			super(name);
		}
		
	}
}
